package com.example.foods.controller;

import com.example.foods.domain.AjaxResult;
import com.example.foods.entity.Tag;
import com.example.foods.service.TagService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/tag")
public class TagController {

    @Resource
    private TagService tagService;

    @GetMapping("/list")
    public AjaxResult list(){
        List<Tag> tagList=this.tagService.findAllTags();
        AjaxResult ajaxResult=AjaxResult.ok(tagList);
        return  ajaxResult;
    }
}
